package com.example.dml.decorator_pattern.high;

/**
 * @Authors：gaoyang
 * @CreateTime：2021-11-01
 * @Description：todo
 */
public class BatterCakeTest {

    public static void main(String[] args) {
        BatterCake batterCake;
        //路边摊买一个煎饼
        batterCake = new BaseBatterCake();
        //煎饼有点小，加个鸡蛋
        batterCake = new EggDecorator(batterCake);
        //再加个鸡蛋
        batterCake = new EggDecorator(batterCake);
        //再加个香肠
        batterCake = new SausageDecorator(batterCake);
        //装饰者模式更多考虑扩展
        System.out.println(batterCake.getMsg()+",总价："+batterCake.getPrice());
    }
}
